import requests
from lxml import etree






urls = [f"https://quotes.toscrape.com/page/{page}/" for page in range(1,3)]

for url in urls:
    # print(url)
    response = requests.get(url)
    tree = etree.HTML(response.content)
    items = tree.xpath("//div[@class='quote']")

    datas = []
    for item in items:
        text = item.xpath(".//span[@class='text']/text()")[0][1:-1]
        author = item.xpath(".//small[@class='author']/text()")[0]
        tags = item.xpath(".//div[@class='tags']/a/text()")
        datas.append({
            "author": author,
            "text": text,
            "tags": tags
        })
    print(datas)











